home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / InputSprocket.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  24.3 KB  |  798 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        InputSprocket.p
  3.  
  4.      Contains:    Games Sprockets: InputSprocket interfaaces
  5.  
  6.      Version:    Technology:    Input Sprocket 1.2
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1996-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT InputSprocket;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __INPUTSPROCKET__}
  28. {$SETC __INPUTSPROCKET__ := 1}
  29.  
  30. {$I+}
  31. {$SETC InputSprocketIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __EVENTS__}
  38. {$I Events.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN POWER}
  44. {$LibExport+}
  45.  
  46. {$IFC UNDEFINED USE_OLD_INPUT_SPROCKET_LABELS }
  47. {$SETC USE_OLD_INPUT_SPROCKET_LABELS := 1 }
  48. {$ENDC}
  49.  
  50. {$IFC UNDEFINED USE_OLD_ISPNEED_STRUCT }
  51. {$SETC USE_OLD_ISPNEED_STRUCT := 1 }
  52. {$ENDC}
  53.  
  54. {$IFC TARGET_CPU_PPC }
  55. { ********************* data types ********************* }
  56.  
  57. TYPE
  58.     ISpDeviceReference = ^LONGINT;
  59.     ISpElementReference = ^LONGINT;
  60.     ISpElementListReference = ^LONGINT;
  61. { ISpDeviceClass is a general classs of device, example: keyboard, mouse, joystick }
  62.     ISpDeviceClass                        = OSType;
  63. { ISpDeviceIdentifier is a specific device,  example: standard 1-button mouse, 105key ext. kbd. }
  64.     ISpDeviceIdentifier                    = OSType;
  65.     ISpElementLabel                        = OSType;
  66.     ISpElementKind                        = OSType;
  67.  
  68. { *************** errors -30420 to -30439***************** }
  69.  
  70. CONST
  71.     kISpInternalErr                = -30420;
  72.     kISpSystemListErr            = -30421;
  73.     kISpBufferToSmallErr        = -30422;
  74.     kISpElementInListErr        = -30423;
  75.     kISpElementNotInListErr        = -30424;
  76.     kISpSystemInactiveErr        = -30425;
  77.     kISpDeviceInactiveErr        = -30426;
  78.     kISpSystemActiveErr            = -30427;
  79.     kISpDeviceActiveErr            = -30428;
  80.     kISpListBusyErr                = -30429;
  81.  
  82. { *************** resources **************** }
  83.     kISpApplicationResourceType    = 'isap';
  84.     kISpSetListResourceType        = 'setl';
  85.     kISpSetDataResourceType        = 'setd';
  86.  
  87.  
  88. TYPE
  89.     ISpApplicationResourceStructPtr = ^ISpApplicationResourceStruct;
  90.     ISpApplicationResourceStruct = RECORD
  91.         flags:                    UInt32;
  92.         reserved1:                UInt32;
  93.         reserved2:                UInt32;
  94.         reserved3:                UInt32;
  95.     END;
  96.  
  97.  
  98. CONST
  99.     kISpAppResFlag_UsesInputSprocket = $00000001;                {  true if the application uses InputSprocket }
  100.     kISpAppResFlag_UsesISpInit    = $00000002;                    {  true if the calls ISpInit (ie, uses the high level interface, calls ISpConfigure, has a needs list, etc...) }
  101.  
  102. {
  103.  * ISpDeviceDefinition
  104.  *
  105.  * This structure provides all the available
  106.  * information for an input device within the system
  107.  *
  108.  }
  109.  
  110. TYPE
  111.     ISpDeviceDefinitionPtr = ^ISpDeviceDefinition;
  112.     ISpDeviceDefinition = RECORD
  113.         deviceName:                Str63;                                    {  a human readable name of the device  }
  114.         theDeviceClass:            ISpDeviceClass;                            {  general classs of device example : keyboard, mouse, joystick  }
  115.         theDeviceIdentifier:    ISpDeviceIdentifier;                    {  every distinguishable device should have an OSType  }
  116.         permanentID:            UInt32;                                    {  a cross reboot id unique within that deviceType, 0 if not possible  }
  117.         flags:                    UInt32;                                    {  status flags  }
  118.         reserved1:                UInt32;
  119.         reserved2:                UInt32;
  120.         reserved3:                UInt32;
  121.     END;
  122.  
  123.  
  124. CONST
  125.     kISpDeviceFlag_HandleOwnEmulation = 1;
  126.  
  127. {
  128.  * ISpElementEvent, ISpElementEventPtr
  129.  *
  130.  * This is the structure that event data is passed in.
  131.  *
  132.  }
  133.  
  134. TYPE
  135.     ISpElementEventPtr = ^ISpElementEvent;
  136.     ISpElementEvent = RECORD
  137.         when:                    AbsoluteTime;                            {  this is absolute time on PCI or later, otherwise it is  }
  138.                                                                         {  0 for the hi 32 bits and TickCount for the low 32 bits  }
  139.         element:                ISpElementReference;                    {  a reference to the element that generated this event  }
  140.         refCon:                    UInt32;                                    {  for application usage, 0 on the global list  }
  141.         data:                    UInt32;                                    {  the data for this event  }
  142.     END;
  143.  
  144. {
  145.  * ISpElementInfo, ISpElementInfoPtr
  146.  *
  147.  * This is the generic definition of an element.
  148.  * Every element must contain this information.
  149.  *
  150.  }
  151.     ISpElementInfoPtr = ^ISpElementInfo;
  152.     ISpElementInfo = RECORD
  153.         theLabel:                ISpElementLabel;
  154.         theKind:                ISpElementKind;
  155.         theString:                Str63;
  156.         reserved1:                UInt32;
  157.         reserved2:                UInt32;
  158.     END;
  159.  
  160.     ISpNeedFlagBits                        = UInt32;
  161. {$IFC USE_OLD_ISPNEED_STRUCT }
  162.     ISpNeedPtr = ^ISpNeed;
  163.     ISpNeed = RECORD
  164.         name:                    Str63;
  165.         iconSuiteResourceId:    INTEGER;                                {  resource id of the icon suite  }
  166.         reserved:                INTEGER;
  167.         theKind:                ISpElementKind;
  168.         theLabel:                ISpElementLabel;
  169.         flags:                    ISpNeedFlagBits;
  170.         reserved1:                UInt32;
  171.         reserved2:                UInt32;
  172.         reserved3:                UInt32;
  173.     END;
  174.  
  175. {$ELSEC}
  176.     ISpNeed = RECORD
  177.         name:                    Str63;                                    {  human-readable string  }
  178.         iconSuiteResourceId:    INTEGER;                                {  resource id of the icon suite  }
  179.         playerNum:                SInt8;                                    {  used for multi-player support  }
  180.         group:                    SInt8;                                    {  used to group related needs (eg, look left and look right button needs)  }
  181.         theKind:                ISpElementKind;
  182.         theLabel:                ISpElementLabel;
  183.         flags:                    ISpNeedFlagBits;
  184.         reserved1:                UInt32;
  185.         reserved2:                UInt32;
  186.         reserved3:                UInt32;
  187.     END;
  188.  
  189. {$ENDC}
  190.  
  191. CONST
  192.     kISpNeedFlag_NoMultiConfig    = $00000001;                    {  once this need is autoconfigured to one device dont autoconfigure to anything else }
  193.     kISpNeedFlag_Utility        = $00000002;                    {  this need is a utility function (like show framerate) which would not typically be assigned to anything but the keyboard }
  194.     kISpNeedFlag_PolledOnly        = $00000004;
  195.     kISpNeedFlag_EventsOnly        = $00000008;                    {  *** kISpElementKind specific flags *** }
  196.                                                                 {  these are flags specific to kISpElementKind_Button }
  197.     kISpNeedFlag_Button_AlreadyAxis = $10000000;                {  there is a axis version of this button need }
  198.     kISpNeedFlag_Button_ClickToggles = $20000000;
  199.     kISpNeedFlag_Button_ActiveWhenDown = $40000000;                {  these are flags specific to kISpElementKind_DPad }
  200.                                                                 {  these are flags specific to kISpElementKind_Axis }
  201.     kISpNeedFlag_Axis_AlreadyButton = $10000000;                {  there is a button version of this axis need }
  202.     kISpNeedFlag_Axis_Asymetric    = $20000000;                    {  this axis need is asymetric     }
  203.                                                                 {  these are flags specific to kISpElementKind_Delta }
  204.     kISpNeedFlag_Delta_AlreadyAxis = $10000000;                    {  there is a axis version of this delta need }
  205.  
  206. {
  207.  *
  208.  * These are the current built values for ISpDeviceClass
  209.  *
  210.  }
  211.     kISpDeviceClass_SpeechRecognition = 'talk';
  212.     kISpDeviceClass_Mouse        = 'mous';
  213.     kISpDeviceClass_Keyboard    = 'keyd';
  214.     kISpDeviceClass_Joystick    = 'joys';
  215.     kISpDeviceClass_Wheel        = 'whel';
  216.     kISpDeviceClass_Pedals        = 'pedl';
  217.     kISpDeviceClass_Levers        = 'levr';
  218.     kISpDeviceClass_Tickle        = 'tckl';                        {  a device of this class requires ISpTickle }
  219.  
  220. {
  221.  * These are the current built in ISpElementKind's
  222.  * 
  223.  * These are all OSTypes.
  224.  *
  225.  }
  226.     kISpElementKind_Button        = 'butn';
  227.     kISpElementKind_DPad        = 'dpad';
  228.     kISpElementKind_Axis        = 'axis';
  229.     kISpElementKind_Delta        = 'dlta';
  230.     kISpElementKind_Movement    = 'move';
  231.     kISpElementKind_Virtual        = 'virt';
  232.  
  233.  
  234. {
  235.  *
  236.  * These are the current built in ISpElementLabel's
  237.  *
  238.  * These are all OSTypes.
  239.  *
  240.  }
  241. {$IFC USE_OLD_INPUT_SPROCKET_LABELS }
  242.                                                                 {  axis  }
  243.     kISpElementLabel_XAxis        = 'xaxi';
  244.     kISpElementLabel_YAxis        = 'yaxi';
  245.     kISpElementLabel_ZAxis        = 'zaxi';
  246.     kISpElementLabel_Rx            = 'rxax';
  247.     kISpElementLabel_Ry            = 'ryax';
  248.     kISpElementLabel_Rz            = 'rzax';
  249.     kISpElementLabel_Gas        = 'gasp';
  250.     kISpElementLabel_Brake        = 'brak';
  251.     kISpElementLabel_Clutch        = 'cltc';
  252.     kISpElementLabel_Throttle    = 'thrt';
  253.     kISpElementLabel_Trim        = 'trim';                        {  direction pad  }
  254.     kISpElementLabel_POVHat        = 'povh';
  255.     kISpElementLabel_PadMove    = 'move';                        {  buttons  }
  256.     kISpElementLabel_Fire        = 'fire';
  257.     kISpElementLabel_Start        = 'strt';
  258.     kISpElementLabel_Select        = 'optn';
  259.  
  260. {$ENDC}
  261.                                                                 {  generic  }
  262.     kISpElementLabel_None        = 'none';                        {  axis  }
  263.     kISpElementLabel_Axis_XAxis    = 'xaxi';
  264.     kISpElementLabel_Axis_YAxis    = 'yaxi';
  265.     kISpElementLabel_Axis_ZAxis    = 'zaxi';
  266.     kISpElementLabel_Axis_Rx    = 'rxax';
  267.     kISpElementLabel_Axis_Ry    = 'ryax';
  268.     kISpElementLabel_Axis_Rz    = 'rzax';
  269.     kISpElementLabel_Axis_Roll    = 'rzax';
  270.     kISpElementLabel_Axis_Pitch    = 'rxax';
  271.     kISpElementLabel_Axis_Yaw    = 'ryax';
  272.     kISpElementLabel_Axis_RollTrim = 'rxtm';
  273.     kISpElementLabel_Axis_PitchTrim = 'trim';
  274.     kISpElementLabel_Axis_YawTrim = 'rytm';
  275.     kISpElementLabel_Axis_Gas    = 'gasp';
  276.     kISpElementLabel_Axis_Brake    = 'brak';
  277.     kISpElementLabel_Axis_Clutch = 'cltc';
  278.     kISpElementLabel_Axis_Throttle = 'thrt';
  279.     kISpElementLabel_Axis_Trim    = 'trim';
  280.     kISpElementLabel_Axis_Rudder = 'rudd';                        {  delta  }
  281.     kISpElementLabel_Delta_X    = 'xdlt';
  282.     kISpElementLabel_Delta_Y    = 'ydlt';
  283.     kISpElementLabel_Delta_Z    = 'zdlt';
  284.     kISpElementLabel_Delta_Rx    = 'rxdl';
  285.     kISpElementLabel_Delta_Ry    = 'rydl';
  286.     kISpElementLabel_Delta_Rz    = 'rzdl';
  287.     kISpElementLabel_Delta_Roll    = 'rzdl';
  288.     kISpElementLabel_Delta_Pitch = 'rxdl';
  289.     kISpElementLabel_Delta_Yaw    = 'rydl';                        {  direction pad  }
  290.     kISpElementLabel_Pad_POV    = 'povh';
  291.     kISpElementLabel_Pad_Move    = 'move';                        {  buttons  }
  292.     kISpElementLabel_Btn_Fire    = 'fire';
  293.     kISpElementLabel_Btn_SecondaryFire = 'sfir';
  294.     kISpElementLabel_Btn_Jump    = 'jump';
  295.     kISpElementLabel_Btn_PauseResume = 'strt';                    {  kISpElementLabel_Btn_PauseResume automatically binds to escape  }
  296.     kISpElementLabel_Btn_Select    = 'optn';
  297.     kISpElementLabel_Btn_SlideLeft = 'blft';
  298.     kISpElementLabel_Btn_SlideRight = 'brgt';
  299.     kISpElementLabel_Btn_MoveForward = 'btmf';
  300.     kISpElementLabel_Btn_MoveBackward = 'btmb';
  301.     kISpElementLabel_Btn_TurnLeft = 'bttl';
  302.     kISpElementLabel_Btn_TurnRight = 'bttr';
  303.     kISpElementLabel_Btn_LookLeft = 'btll';
  304.     kISpElementLabel_Btn_LookRight = 'btlr';
  305.     kISpElementLabel_Btn_LookUp    = 'btlu';
  306.     kISpElementLabel_Btn_LookDown = 'btld';
  307.     kISpElementLabel_Btn_Next    = 'btnx';
  308.     kISpElementLabel_Btn_Previous = 'btpv';
  309.     kISpElementLabel_Btn_SideStep = 'side';
  310.     kISpElementLabel_Btn_Run    = 'quik';
  311.     kISpElementLabel_Btn_Look    = 'blok';
  312.  
  313. {
  314.  *
  315.  * direction pad data & configuration information
  316.  *
  317.  }
  318.  
  319. TYPE
  320.     ISpDPadData                            = UInt32;
  321.  
  322. CONST
  323.     kISpPadIdle                    = 0;
  324.     kISpPadLeft                    = 1;
  325.     kISpPadUpLeft                = 2;
  326.     kISpPadUp                    = 3;
  327.     kISpPadUpRight                = 4;
  328.     kISpPadRight                = 5;
  329.     kISpPadDownRight            = 6;
  330.     kISpPadDown                    = 7;
  331.     kISpPadDownLeft                = 8;
  332.  
  333.  
  334. TYPE
  335.     ISpDPadConfigurationInfoPtr = ^ISpDPadConfigurationInfo;
  336.     ISpDPadConfigurationInfo = RECORD
  337.         id:                        UInt32;                                    {  ordering 1..n, 0 = no relavent ordering of direction pads  }
  338.         fourWayPad:                BOOLEAN;                                {  true if this pad can only produce idle + four directions  }
  339.     END;
  340.  
  341. {
  342.  *
  343.  * button data & configuration information
  344.  *
  345.  }
  346.     ISpButtonData                        = UInt32;
  347.  
  348. CONST
  349.     kISpButtonUp                = 0;
  350.     kISpButtonDown                = 1;
  351.  
  352.  
  353. TYPE
  354.     ISpButtonConfigurationInfoPtr = ^ISpButtonConfigurationInfo;
  355.     ISpButtonConfigurationInfo = RECORD
  356.         id:                        UInt32;                                    {  ordering 1..n, 0 = no relavent ordering of buttons  }
  357.     END;
  358.  
  359. {
  360.  *
  361.  * axis data & configuration information 
  362.  *
  363.  }
  364.     ISpAxisData                            = UInt32;
  365.     ISpAxisConfigurationInfoPtr = ^ISpAxisConfigurationInfo;
  366.     ISpAxisConfigurationInfo = RECORD
  367.         symetricAxis:            BOOLEAN;                                {  axis is symetric, i.e. a joystick is symetric and a gas pedal is not  }
  368.     END;
  369.  
  370.     ISpDeltaData                        = Fixed;
  371.     ISpDeltaConfigurationInfoPtr = ^ISpDeltaConfigurationInfo;
  372.     ISpDeltaConfigurationInfo = RECORD
  373.         reserved1:                UInt32;
  374.         reserved2:                UInt32;
  375.     END;
  376.  
  377.     ISpMovementDataPtr = ^ISpMovementData;
  378.     ISpMovementData = RECORD
  379.         xAxis:                    ISpAxisData;
  380.         yAxis:                    ISpAxisData;
  381.         direction:                ISpDPadData;                            {  ISpDPadData version of the movement  }
  382.     END;
  383.  
  384.  
  385. CONST
  386.     kISpVirtualElementFlag_UseTempMem = 1;
  387.  
  388.     kISpElementListFlag_UseTempMem = 1;
  389.  
  390.     kISpFirstIconSuite            = 30000;
  391.     kISpLastIconSuite            = 30100;
  392.     kISpNoneIconSuite            = 30000;
  393.  
  394. { ********************* user level functions ********************* }
  395.  
  396.  
  397. {
  398.  *
  399.  * startup / shutdown
  400.  *
  401.  }
  402. FUNCTION ISpStartup: OSStatus; C;
  403. {  1.1 or later }
  404. FUNCTION ISpShutdown: OSStatus; C;
  405. {  1.1 or later }
  406. {
  407.  *
  408.  * polling
  409.  *
  410.  }
  411. FUNCTION ISpTickle: OSStatus; C;
  412. {  1.1 or later }
  413. {********* user interface functions *********}
  414.  
  415. FUNCTION ISpGetVersion: NumVersion; C;
  416. {
  417.  *
  418.  * ISpElement_NewVirtual(ISpElementReference *outElement);
  419.  *
  420.  }
  421. FUNCTION ISpElement_NewVirtual(dataSize: UInt32; VAR outElement: ISpElementReference; flags: UInt32): OSStatus; C;
  422. {
  423.  *
  424.  * ISpElement_NewVirtualFromNeeds(UInt32 count, ISpNeeds *needs, ISpElementReference *outElements);
  425.  *
  426.  }
  427. FUNCTION ISpElement_NewVirtualFromNeeds(count: UInt32; VAR needs: ISpNeed; VAR outElements: ISpElementReference; flags: UInt32): OSStatus; C;
  428. {
  429.  *
  430.  * ISpElement_DisposeVirtual(inElement);
  431.  *
  432.  }
  433. FUNCTION ISpElement_DisposeVirtual(count: UInt32; VAR inElements: ISpElementReference): OSStatus; C;
  434. {
  435.  * ISpInit
  436.  *
  437.  }
  438. FUNCTION ISpInit(count: UInt32; VAR needs: ISpNeed; VAR inReferences: ISpElementReference; appCreatorCode: OSType; subCreatorCode: OSType; flags: UInt32; setListResourceId: INTEGER; reserved: UInt32): OSStatus; C;
  439.  
  440. {
  441.  * ISpConfigure
  442.  *
  443.  }
  444.  
  445. TYPE
  446.     ISpEventProcPtr = ProcPtr;  { FUNCTION ISpEvent(VAR inEvent: EventRecord): BOOLEAN; C; }
  447.  
  448. FUNCTION ISpConfigure(inEventProcPtr: ISpEventProcPtr): OSStatus; C;
  449. {
  450.  *
  451.  * ISpStop
  452.  *
  453.  }
  454. FUNCTION ISpStop: OSStatus; C;
  455. {
  456.  *
  457.  * ISpSuspend, ISpResume
  458.  *
  459.  * ISpSuspend turns all devices off and allocates memory so that the state may be later resumed.
  460.  * ISpResume resumes to the previous state of the system after a suspend call.
  461.  * 
  462.  * Return Codes
  463.  * memFullErr
  464.  *
  465.  }
  466. FUNCTION ISpSuspend: OSStatus; C;
  467. FUNCTION ISpResume: OSStatus; C;
  468. {
  469.  * ISpDevices_Extract, ISpDevices_ExtractByClass, ISpDevices_ExtractByIdentifier
  470.  *
  471.  * These will extract as many device references from the system wide list as will fit in your buffer.  
  472.  *
  473.  * inBufferCount - the size of your buffer (in units of sizeof(ISpDeviceReference)) this may be zero
  474.  * buffer - a pointer to your buffer
  475.  * outCount - contains the number of devices in the system
  476.  *
  477.  * ISpDevices_ExtractByClass extracts and counts devices of the specified ISpDeviceClass
  478.  * ISpDevices_ExtractByIdentifier extracts and counts devices of the specified ISpDeviceIdentifier
  479.  *
  480.  * Return Codes
  481.  * paramErr
  482.  *
  483.  }
  484. FUNCTION ISpDevices_Extract(inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpDeviceReference): OSStatus; C;
  485. FUNCTION ISpDevices_ExtractByClass(inClass: ISpDeviceClass; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpDeviceReference): OSStatus; C;
  486. FUNCTION ISpDevices_ExtractByIdentifier(inIdentifier: ISpDeviceIdentifier; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpDeviceReference): OSStatus; C;
  487.  
  488. {
  489.  * ISpDevices_ActivateClass, ISpDevices_DeactivateClass, ISpDevices_Activate, ISpDevices_Deactivate, ISpDevice_IsActive
  490.  *
  491.  * ISpDevices_Activate, ISpDevices_Deactivate
  492.  *
  493.  * This will activate/deactivate a block of devices.
  494.  * inDeviceCount - the number of devices to activate / deactivate
  495.  * inDevicesToActivate/inDevicesToDeactivate - a pointer to a block of memory contains the devices references
  496.  *
  497.  * ISpDevices_ActivateClass, ISpDevices_DeactivateClass
  498.  * inClass - the class of devices to activate or deactivate
  499.  *
  500.  * ISpDevice_IsActive
  501.  * inDevice - the device reference that you wish to 
  502.  * outIsActive - a boolean value that is true when the device is active
  503.  *
  504.  * Return Codes
  505.  * paramErr
  506.  *
  507.  }
  508. FUNCTION ISpDevices_ActivateClass(inClass: ISpDeviceClass): OSStatus; C;
  509. {  1.1 or later }
  510. FUNCTION ISpDevices_DeactivateClass(inClass: ISpDeviceClass): OSStatus; C;
  511. {  1.1 or later }
  512. FUNCTION ISpDevices_Activate(inDeviceCount: UInt32; VAR inDevicesToActivate: ISpDeviceReference): OSStatus; C;
  513. FUNCTION ISpDevices_Deactivate(inDeviceCount: UInt32; VAR inDevicesToDeactivate: ISpDeviceReference): OSStatus; C;
  514. FUNCTION ISpDevice_IsActive(inDevice: ISpDeviceReference; VAR outIsActive: BOOLEAN): OSStatus; C;
  515. {
  516.  * ISpDevice_GetDefinition
  517.  *
  518.  *
  519.  * inDevice - the device you want to get the definition for
  520.  * inBuflen - the size of the structure (sizeof(ISpDeviceDefinition))
  521.  * outStruct - a pointer to where you want the structure copied
  522.  *
  523.  * Return Codes
  524.  * paramErr
  525.  *
  526.  }
  527. FUNCTION ISpDevice_GetDefinition(inDevice: ISpDeviceReference; inBuflen: UInt32; VAR outStruct: ISpDeviceDefinition): OSStatus; C;
  528.  
  529. {
  530.  *
  531.  * ISpDevice_GetElementList
  532.  *
  533.  * inDevice - the device whose element list you wish to get
  534.  * outElementList - a pointer to where you want a reference to that list stored
  535.  *
  536.  * Return Codes
  537.  * paramErr
  538.  *
  539.  }
  540. FUNCTION ISpDevice_GetElementList(inDevice: ISpDeviceReference; VAR outElementList: ISpElementListReference): OSStatus; C;
  541. {
  542.  *
  543.  * takes an ISpElementReference and returns the group that it is in or 0 if there is
  544.  * no group
  545.  *
  546.  * Return Codes
  547.  * paramErr
  548.  *
  549.  }
  550. FUNCTION ISpElement_GetGroup(inElement: ISpElementReference; VAR outGroup: UInt32): OSStatus; C;
  551. {
  552.  *
  553.  * takes an ISpElementReference and returns the device that the element belongs 
  554.  * to.
  555.  *
  556.  * Return Codes
  557.  * paramErr if inElement is 0 or outDevice is nil
  558.  *
  559.  }
  560. FUNCTION ISpElement_GetDevice(inElement: ISpElementReference; VAR outDevice: ISpDeviceReference): OSStatus; C;
  561. {
  562.  *
  563.  * takes an ISpElementReference and gives the ISpElementInfo for that Element.  This is the
  564.  * the set of standard information.  You get ISpElementKind specific information
  565.  * through ISpElement_GetConfigurationInfo.
  566.  *
  567.  * Return Codes
  568.  * paramErr if inElement is 0 or outInfo is nil
  569.  *
  570.  }
  571. FUNCTION ISpElement_GetInfo(inElement: ISpElementReference; outInfo: ISpElementInfoPtr): OSStatus; C;
  572. {
  573.  *
  574.  *         
  575.  *
  576.  * takes an ISpElementReference and gives the ISpElementKind specific configuration information
  577.  * 
  578.  * if buflen is not long enough to hold the information ISpElement_GetConfigurationInfo will
  579.  * copy buflen bytes of the data into the block of memory pointed to by configInfo and
  580.  * will return something error.
  581.  *
  582.  * Return Codes
  583.  * paramErr if inElement or configInfo is nil
  584.  *
  585.  }
  586. FUNCTION ISpElement_GetConfigurationInfo(inElement: ISpElementReference; buflen: UInt32; configInfo: UNIV Ptr): OSStatus; C;
  587. {
  588.  *
  589.  * ISpElement_GetSimpleState
  590.  *
  591.  * Takes an ISpElementReference and returns the current state of that element.  This is a 
  592.  * specialized version of ISpElement_GetComplexState that is only appropriate for elements
  593.  * whose data fits in a signed 32 bit integer.
  594.  *
  595.  *
  596.  *
  597.  * Return Codes
  598.  * paramErr if inElement is 0 or state is nil
  599.  *
  600.  }
  601. FUNCTION ISpElement_GetSimpleState(inElement: ISpElementReference; VAR state: UInt32): OSStatus; C;
  602. {
  603.  *
  604.  * ISpElement_GetComplexState
  605.  *
  606.  * Takes an ISpElementReference and returns the current state of that element.  
  607.  * Will copy up to buflen bytes of the current state of the device into
  608.  * state.
  609.  *
  610.  *
  611.  * Return Codes
  612.  * paramErr if inElement is 0 or state is nil
  613.  *
  614.  }
  615. FUNCTION ISpElement_GetComplexState(inElement: ISpElementReference; buflen: UInt32; state: UNIV Ptr): OSStatus; C;
  616.  
  617. {
  618.  * ISpElement_GetNextEvent
  619.  *
  620.  * It takes in an element  reference and the buffer size of the ISpElementEventPtr
  621.  * it will set wasEvent to true if there was an event and false otherwise.  If there
  622.  * was not enough space to fill in the whole event structure that event will be
  623.  * dequed, as much of the event as will fit in the buffer will by copied and
  624.  * ISpElement_GetNextEvent will return an error.
  625.  *
  626.  * Return Codes
  627.  * paramErr
  628.  *
  629.  }
  630. FUNCTION ISpElement_GetNextEvent(inElement: ISpElementReference; bufSize: UInt32; event: ISpElementEventPtr; VAR wasEvent: BOOLEAN): OSStatus; C;
  631. {
  632.  *
  633.  * ISpElement_Flush
  634.  *
  635.  * It takes an ISpElementReference and flushes all the events on that element.  All it guaruntees is
  636.  * that any events that made it to this layer before the time of the flush call will be flushed and
  637.  * it will not flush any events that make it to this layer after the time when the call has returned.
  638.  * What happens to events that occur during the flush is undefined.
  639.  *
  640.  *
  641.  * Return Codes
  642.  * paramErr
  643.  *
  644.  }
  645. FUNCTION ISpElement_Flush(inElement: ISpElementReference): OSStatus; C;
  646.  
  647.  
  648. {
  649.  * ISpElementList_New
  650.  *
  651.  * Creates a new element list and returns it in outElementList.  In count specifies 
  652.  * the number of element references in the list pointed to by inElements.  If inCount
  653.  * is non zero the list is created with inCount elements in at as specified by the 
  654.  * inElements parameter.  Otherwise the list is created empty.
  655.  *
  656.  *
  657.  * Return Codes
  658.  * out of memory - If it failed to allocate the list because it was out of memory
  659.                    it will also set outElementList to 0
  660.  * paramErr if outElementList was nil
  661.  *
  662.  *
  663.  * Special Concerns
  664.  *
  665.  * interrupt unsafe
  666.  *
  667.  }
  668. FUNCTION ISpElementList_New(inCount: UInt32; VAR inElements: ISpElementReference; VAR outElementList: ISpElementListReference; flags: UInt32): OSStatus; C;
  669. {
  670.  * ISpElementList_Dispose
  671.  *
  672.  * Deletes an already existing memory list.  
  673.  *
  674.  *
  675.  * Return Codes
  676.  * paramErr if inElementList was 0
  677.  *
  678.  *
  679.  * Special Concerns
  680.  *
  681.  * interrupt unsafe
  682.  *
  683.  }
  684. FUNCTION ISpElementList_Dispose(inElementList: ISpElementListReference): OSStatus; C;
  685. {
  686.  * ISpGetGlobalElementList
  687.  *
  688.  * returns the global element list
  689.  *
  690.  * Return Codes
  691.  * paramErr if outElementList is nil
  692.  *
  693.  }
  694. FUNCTION ISpGetGlobalElementList(VAR outElementList: ISpElementListReference): OSStatus; C;
  695. {
  696.  * ISpElementList_AddElement
  697.  *
  698.  * adds an element to the element list
  699.  *
  700.  * Return Codes
  701.  * paramErr if inElementList is 0 or newElement is 0
  702.  * memory error if the system is unable to allocate enough memory
  703.  *
  704.  * Special Concerns
  705.  * interrupt Unsafe
  706.  * 
  707.  }
  708. FUNCTION ISpElementList_AddElements(inElementList: ISpElementListReference; refCon: UInt32; count: UInt32; VAR newElements: ISpElementReference): OSStatus; C;
  709. {
  710.  * ISpElementList_RemoveElement
  711.  *
  712.  * removes the specified element from the element list
  713.  *
  714.  * Return Codes
  715.  * paramErr if inElementList is 0 or oldElement is 0
  716.  * memory error if the system is unable to allocate enough memory
  717.  *
  718.  * Special Concerns
  719.  * interrupt Unsafe
  720.  * 
  721.  }
  722. FUNCTION ISpElementList_RemoveElements(inElementList: ISpElementListReference; count: UInt32; VAR oldElement: ISpElementReference): OSStatus; C;
  723. {
  724.  * ISpElementList_Extract
  725.  *
  726.  * ISpElementList_Extract will extract as many of the elements from an element list as possible.  You pass
  727.  * in an element list, a pointer to an array of element references and the number of elements in that array.
  728.  * It will return how many items are in the element list in the outCount parameter and copy the minimum of 
  729.  * that number and the size of the array into the buffer.
  730.  *
  731.  * ByKind and ByLabel are the same except that they will only count and copy element references to elements
  732.  * that have the specified kind and label.
  733.  *
  734.  * Return Codes
  735.  * paramErr
  736.  *
  737.  }
  738. FUNCTION ISpElementList_Extract(inElementList: ISpElementListReference; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpElementReference): OSStatus; C;
  739. FUNCTION ISpElementList_ExtractByKind(inElementList: ISpElementListReference; inKind: ISpElementKind; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpElementReference): OSStatus; C;
  740. FUNCTION ISpElementList_ExtractByLabel(inElementList: ISpElementListReference; inLabel: ISpElementLabel; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpElementReference): OSStatus; C;
  741. {
  742.  * ISpElementList_GetNextEvent
  743.  *
  744.  * It takes in an element list reference and the buffer size of the ISpElementEventPtr
  745.  * it will set wasEvent to true if there was an event and false otherwise.  If there
  746.  * was not enough space to fill in the whole event structure that event will be
  747.  * dequed, as much of the event as will fit in the buffer will by copied and
  748.  * ISpElementList_GetNextEvent will return an error.
  749.  *
  750.  * Return Codes
  751.  * paramErr
  752.  *
  753.  }
  754. FUNCTION ISpElementList_GetNextEvent(inElementList: ISpElementListReference; bufSize: UInt32; event: ISpElementEventPtr; VAR wasEvent: BOOLEAN): OSStatus; C;
  755. {
  756.  *
  757.  * ISpElementList_Flush
  758.  *
  759.  * It takes an ISpElementListReference and flushes all the events on that list.  All it guaruntees is
  760.  * that any events that made it to this layer before the time of the flush call will be flushed and
  761.  * it will not flush any events that make it to this layer after the time when the call has returned.
  762.  * What happens to events that occur during the flush is undefined.
  763.  *
  764.  *
  765.  * Return Codes
  766.  * paramErr
  767.  *
  768.  }
  769. FUNCTION ISpElementList_Flush(inElementList: ISpElementListReference): OSStatus; C;
  770. {
  771.  *
  772.  * ISpTimeToMicroseconds
  773.  *
  774.  *
  775.  * This function takes time from an input sprocket event and converts it
  776.  * into microseconds. (Version 1.2 or later of InputSprocket.)
  777.  *
  778.  *
  779.  * Return Codes
  780.  * paramErr
  781.  *
  782.  }
  783. FUNCTION ISpTimeToMicroseconds({CONST}VAR inTime: AbsoluteTime; VAR outMicroseconds: UnsignedWide): OSStatus; C;
  784.  
  785. {$ENDC}  {TARGET_CPU_PPC}
  786.  
  787.  
  788. {$ALIGN RESET}
  789. {$POP}
  790.  
  791. {$SETC UsingIncludes := InputSprocketIncludes}
  792.  
  793. {$ENDC} {__INPUTSPROCKET__}
  794.  
  795. {$IFC NOT UsingIncludes}
  796.  END.
  797. {$ENDC}
  798.